<!-- Comments -->
<script type="text/javascript">
$(function(){
	$('.auto-submit-star').rating()
});
</script>

<div>
	<?php foreach ($this->comments as $comment): ?>
		<div id="comment-date"><?php echo date("jS F Y G:H:s",strtotime($comment['created'])) ?></div>
		<div id="comment-user">By <?php echo $comment['name'] ?></div>
		<div id="comment-content"><?php echo $comment['comment'] ?></div>
		<?php if ( isset( $comment['value'] ) ): ?>
			<p>Rated <?php echo $this->starRating( $comment['recipe_id'], $comment['id'], $comment['value'] ) ?></p>
		<?php else: ?>
			<p>User has not rated this</p>
		<?php endif ?>
		<?php if ( $this->loggedIn() && $this->checkOwner( $comment['user_id'] ) ): ?>
			<a href="<?php echo "/comment/delete/id/".$comment['id'] ?>">Delete</a> | Report
		<?php endif ?>
	<?php endforeach ?>
</div>

<?php if ( $this->pagination( $this->pagination_config )->total_pages > 1 ): ?>
<?php echo $this->pagination( $this->pagination_config )->create_links(); ?>
<?php endif ?>
<!-- End of Comments -->
